package com.tzq.bmsadmin.mapper;

import com.tzq.bmsadmin.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface UserMapper {
    @Select("SELECT * from stu_user")
    List<User> findAll();

    @Insert("INSERT into stu_user(name,`password`,age,sex) VALUES (#{name}, #{password},#{age}, #{sex})")
    int insert(User user);

    int update(User user);

    @Delete("delete from stu_user where id = #{id}")
    Integer deleteById(@Param("id") Integer id);

    @Select("select * from stu_user limit #{pageNum}, #{pageSize}")
    List<User> selectPage(Integer pageNum, Integer pageSize);

    @Select("select count(*) from stu_user")
    Integer selectTotal();
}
